VERSION 5.00
Object = "{19BD1EA6-6E36-45BA-AEBD-BCF3093017CC}#11.0#0"; "GorditoButton.ocx"
Begin VB.Form frmReasignarMesa 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   3675
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9165
   BeginProperty Font 
      Name            =   "Book Antiqua"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3675
   ScaleWidth      =   9165
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame fraContenedor 
      BackColor       =   &H00FFC0C0&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3285
      Left            =   0
      TabIndex        =   0
      Top             =   360
      Width           =   9165
      Begin VB.ComboBox cboEmpleado 
         BeginProperty Font 
            Name            =   "Book Antiqua"
            Size            =   26.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Left            =   3060
         TabIndex        =   9
         Top             =   2070
         Width           =   4425
      End
      Begin VB.TextBox txtCodigoEmp 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Book Antiqua"
            Size            =   26.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Left            =   2160
         MaxLength       =   4
         TabIndex        =   8
         Top             =   2070
         Width           =   885
      End
      Begin VB.ComboBox cboMesaOrigen 
         BeginProperty Font 
            Name            =   "Book Antiqua"
            Size            =   36
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   990
         Left            =   2160
         Style           =   2  'Dropdown List
         TabIndex        =   4
         Top             =   870
         Width           =   2025
      End
      Begin VB.Frame frParametros 
         BackColor       =   &H80000014&
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   -30
         TabIndex        =   1
         Top             =   0
         Width           =   15255
         Begin VB.Label Label2 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "Seleccionar Mesas"
            BeginProperty Font 
               Name            =   "Book Antiqua"
               Size            =   20.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   480
            Left            =   120
            TabIndex        =   2
            Top             =   120
            Width           =   3450
         End
      End
      Begin GorditoButton.Boton cmdLiberar 
         Height          =   1065
         Left            =   7680
         TabIndex        =   6
         Top             =   690
         Width           =   1245
         _ExtentX        =   2196
         _ExtentY        =   1879
         Caption         =   "OK"
         BackColor       =   12648384
         ResalteColor    =   12648384
         IntensityColor  =   4
         ButtonStyle     =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Book Antiqua"
            Size            =   20.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   16777215
      End
      Begin GorditoButton.Boton cmdSalir 
         Height          =   1065
         Left            =   7680
         TabIndex        =   7
         Top             =   1890
         Width           =   1245
         _ExtentX        =   2196
         _ExtentY        =   1879
         Caption         =   "Exit"
         BackColor       =   12648384
         ResalteColor    =   12648384
         IntensityColor  =   4
         ButtonStyle     =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Book Antiqua"
            Size            =   20.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   16777215
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Mozo  :"
         BeginProperty Font 
            Name            =   "Book Antiqua"
            Size            =   20.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00808080&
         Height          =   480
         Left            =   300
         TabIndex        =   10
         Top             =   2160
         Width           =   1365
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Mesa  :"
         BeginProperty Font 
            Name            =   "Book Antiqua"
            Size            =   20.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00808080&
         Height          =   480
         Left            =   300
         TabIndex        =   5
         Top             =   1020
         Width           =   1275
      End
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Reasignar Mesa"
      BeginProperty Font 
         Name            =   "Book Antiqua"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   480
      Left            =   60
      TabIndex        =   3
      Top             =   -60
      Width           =   2865
   End
End
Attribute VB_Name = "frmReasignarMesa"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private mvarlistaMesasOcupadas As Collection
Private mvarListaEmpleados As Collection
Private mvarBean As bempleado
Private control As New cmesa
Private controlp As New cprincipal
Private lempleado As New lempleado
Private lPedido As New lPedido
Private lMesa As lMesa
Private bean As bpedido

Private Sub cboMesaOrigen_Click()
'Dim bMesa As bMesa
'Dim bpedido As bpedido
'Set bMesa = listaMesasOcupadas.Item(Me.cboMesaOrigen.ListIndex + 1)
'abrirMesa bMesa
'Set listaEmpleado = lempleado.getListaxCodigo(Val(bean.nempleado.ncodigo))
End Sub

Private Sub cmdLiberar_Click()
'If Trim(Me.txtCodigoEmp.Text) = "" Then
'    utilMensaje.muestraMensaje (CampoRequerido)
'Exit Sub
'End If
'Dim actualiza, det As Integer
'Dim bDetalle As New bDetalle
'bean.nempleado.ncodigo = Val(Me.txtCodigoEmp.Text)
'actualiza = lPedido.ActualizaEmpleado(bean)
'bDetalle.ncodigo = bean.ncodigo
'bDetalle.bempleado.ncodigo = Val(Me.txtCodigoEmp.Text)
'det = lPedido.ActualizaEmpleadoDetalle(bDetalle)
'Unload Me
End Sub

Private Sub cmdSalir_Click()
Unload Me
End Sub

Private Sub Form_Load()
    Call p_CentrarForm(Me, frmTablero)
 
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set mvarlistaMesasOcupadas = Nothing
    Set mvarListaEmpleados = Nothing
End Sub


Public Property Get listaMesasOcupadas() As Collection
    Set listaMesasOcupadas = mvarlistaMesasOcupadas
End Property

Public Property Set listaMesasOcupadas(listaMesasOcupadas As Collection)
    Set mvarlistaMesasOcupadas = listaMesasOcupadas
    llenarListaOcupadas
End Property

Private Sub llenarListaOcupadas()
Dim i As Integer
Dim bMesa As bMesa
For i = 1 To mvarlistaMesasOcupadas.Count
    Set bMesa = mvarlistaMesasOcupadas.Item(i)
    Me.cboMesaOrigen.AddItem UCase(bMesa.sDescripcion)
Next
End Sub
Public Sub llenaListaEmpleados()
Dim i As Integer
Dim bempleado As bempleado
Me.cboEmpleado.Clear
For i = 1 To mvarListaEmpleados.Count
    Set bempleado = mvarListaEmpleados.Item(i)
    Me.cboEmpleado.AddItem UCase(bempleado.sNombreCorto)
Next
End Sub
Public Property Get listaEmpleado() As Collection
Set listaEmpleado = mvarListaEmpleados
End Property

Public Property Set listaEmpleado(vData As Collection)
Set mvarListaEmpleados = vData
llenaListaEmpleados
End Property
Private Sub cboEmpleado_Click()
If cboEmpleado.ListIndex >= 0 Then
 Set mvarBean = listaEmpleado.Item(Me.cboEmpleado.ListIndex + 1)
 Me.txtCodigoEmp.Text = mvarBean.ncodigo
End If
End Sub
Public Sub abrirMesa(bMesa As bMesa)
Dim error As Integer
Dim bpaginador As New bpaginador
If bMesa.bEstado.ncodigo = UtilConstantes.ESTADO_MESA_LIBRE Or bMesa.bEstado.ncodigo = UtilConstantes.ESTADO_MESA_RESERVADA Then
    Exit Sub
End If
If Not bMesa.bEstado.ncodigo = UtilConstantes.ESTADO_MESA_LIBRE Then
    Set bean = lPedido.getPedidoPorMesa(bMesa)
End If
If bean Is Nothing Then
    Set bean = New bpedido
    Set bean.busuario = bparametro.bUsuarioActivo
    Set bean.bCompania = bparametro.bCompaniadPorDefecto
    Set bean.bMesa = bMesa
    bean.bTipoDocumento.ncodigo = UtilConstantes.TIPO_DOCUMENTO_BOLETA
    bean.sSerDocumento = bparametro.bCompaniadPorDefecto.bPuntoVenta.sSerie
    lMesa.setOcupada bMesa
    bean.bEstado.ncodigo = UtilConstantes.ESTADO_PEDIDO_PENDIENTE
    bean.nTipCambio = bparametro.nTipoCambio
    bean.bTipoDocumento.ncodigo = UtilConstantes.TIPO_DOCUMENTO_BOLETA
End If
End Sub
